<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>nav</title>
    <style>
        .container {
            width: 1200px;
            margin: 10px auto;
        }
        .nav ul {
            list-style-type: none;  /*移除项目编号*/
            margin: 0;
            padding: 0;
        }
        .nav li {   /*水平布局*/
            float: left;
        }
        .nav a {
            text-decoration: none;   /*去除下画线*/
            display: block;   /*转成块级元素以设置宽度*/
            width: 200px;
            height: 30px;
            text-align: center;
            font-size: 20px;
            line-height: 30px;  /*设置写文字时的行高，文字默认居中显示*/
            background-color: #BEBEBE;
            border-bottom: 2px solid darkred;
        }
        .nav a:hover {
            color: white;
            background-color: darkred;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="nav">
        <ul>
            <li><a href="#">HOME</a></li>
            <li><a href="#">NEWS</a></li>
            <li><a href="#">TECH</a></li>
            <li><a href="#">BLOG</a></li>
            <li><a href="#">BBS</a></li>
            <li><a href="#">CONTACT</a></li>
        </ul>
    </div>
</div>
</body>
</html>